﻿//-----------------------------------------------------------------------
// <copyright file="Do.cs" company="tuliprules.org">
//     Copyright (c) 2011 tuplelister, tuliprules.org.
// </copyright>
// <summary>This is the Do class.</summary>
//-----------------------------------------------------------------------

namespace Tulip.Rules.Models.Rif.Prd
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Xml.Serialization;

    /// <summary>
    /// Represents an Action block.
    /// </summary>
    [Serializable]
    [DesignerCategory(@"code")]
    [XmlType(AnonymousType = true, Namespace = "http://www.w3.org/2007/rif#")]
    [XmlRoot(Namespace = "http://www.w3.org/2007/rif#", IsNullable = false)]
    public class Do : Irimeta, IRifPrdElement
    {
        /// <summary>
        /// A collection of actionVarsField fields.
        /// </summary>
        [EditorBrowsable(EditorBrowsableState.Never)]
        private List<ActionVar> actionVarsField;

        /// <summary>
        /// The actions field.
        /// </summary>
        [EditorBrowsable(EditorBrowsableState.Never)]
        private Actions actionsField;

        /// <summary>
        /// Initializes a new instance of the <see cref="Do"/> class.
        /// </summary>
        public Do()
        {
            this.actionVarsField = new List<ActionVar>();
        }

        /// <summary>
        /// Gets or sets a list of action variable declarations.
        /// </summary>
        [XmlElement("actionVar", Order = 0)]
        public List<ActionVar> ActionVars
        {
            get
            {
                return this.actionVarsField;
            }

            set
            {
                this.actionVarsField = value;
            }
        }

        /// <summary>
        /// Gets or sets a formula role, containing a FORMULA.
        /// </summary>
        [XmlElement("actions", Order = 1)]
        public Actions Actions
        {
            get
            {
                return this.actionsField;
            }

            set
            {
                this.actionsField = value;
            }
        }
    }
}